/*
 * guiWrapper.h
 *
 *  Created on: Mar 8, 2011
 *      Author: benjones
 */

#ifndef GUIWRAPPER_H_
#define GUIWRAPPER_H_

#include <QMainWindow>
#include "listener.h"
#include <cstring>
#include "uiEncap.h"
#include "server.h"
#include "client.h"
#include "clientForm.h"
#include "serverForm.h"
#include "comms.h"
#include <QDialog>

class guiWrapper : public QObject, public listener
{
	Q_OBJECT

public:
	guiWrapper();
	void handleParams();

	void initiateFileSend(std::string fname,bool yes);

	struct accessHelper
	{
		guiWrapper* This;
		//int extra;
		void *actual_arg;
		accessHelper(guiWrapper* t, void* p):This(t),actual_arg(p) {}
	};



	comms *coms;
	int mode;
	QDialog *paramsWidget;
	QDialog *qd; // for file accept!
	Ui_ServerDialog *sd;
	Ui_ClientDialog *cd;

	//std::string fileReceiveString;


private:


protected slots:
	void serverButtonClicked();
	void connectButtonClicked();
	void sendButtonClicked();
	void syncButtonClicked();
	void serverFormOk();
	void processComEvents();
};




#endif /* GUIWRAPPER_H_ */
